﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="manOrg.aspx.cs" Inherits="manager_org_manOrg" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>组织概要</title>
    <link href="../sytle/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="main">
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
            DeleteCommand="DELETE FROM [organization] WHERE [organizationid] = @organizationid" 
            InsertCommand="INSERT INTO [organization] ([organizationid], [creator], [organizationname], [address], [postcode], [phone], [createdtime], [contactperson], [contactemail], [description]) VALUES (@organizationid, @creator, @organizationname, @address, @postcode, @phone, @createdtime, @contactperson, @contactemail, @description)" 
            SelectCommand="SELECT * FROM [organization] WHERE ([organizationid] = @organizationid)" 
            UpdateCommand="UPDATE [organization] SET [creator] = @creator, [organizationname] = @organizationname, [address] = @address, [postcode] = @postcode, [phone] = @phone, [createdtime] = @createdtime, [contactperson] = @contactperson, [contactemail] = @contactemail, [description] = @description WHERE [organizationid] = @organizationid">
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" Name="organizationid" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="organizationid" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="creator" Type="String" />
                <asp:Parameter Name="organizationname" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="createdtime" Type="DateTime" />
                <asp:Parameter Name="contactperson" Type="String" />
                <asp:Parameter Name="contactemail" Type="String" />
                <asp:Parameter Name="description" Type="String" />
                <asp:Parameter Name="organizationid" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="organizationid" Type="Int32" />
                <asp:Parameter Name="creator" Type="String" />
                <asp:Parameter Name="organizationname" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="createdtime" Type="DateTime" />
                <asp:Parameter Name="contactperson" Type="String" />
                <asp:Parameter Name="contactemail" Type="String" />
                <asp:Parameter Name="description" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
            
            
            
            
            SelectCommand="SELECT organization.organizationname, organization.organizationid, users.realname, organization.creator FROM organization INNER JOIN users ON organization.organizationid = users.organizationid AND organization.creator = users.username INNER JOIN login ON users.username = login.username WHERE (login.available = 'true')"></asp:SqlDataSource>
    <div id="content">
        <div id="left">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                DataKeyNames="organizationid" DataSourceID="SqlDataSource1" 
                style="margin-bottom: 0px" EmptyDataText="没有组织">
                <FooterStyle BackColor="White" ForeColor="#000066" />
                <RowStyle ForeColor="#000066" />
                <Columns>
                    <asp:HyperLinkField DataNavigateUrlFields="creator" 
                        DataNavigateUrlFormatString="~/sys/users/modipwd.aspx?un={0}" Text="更改<br />密码" />
                    <asp:HyperLinkField DataNavigateUrlFields="creator" 
                        DataNavigateUrlFormatString="~/manager/org/del.aspx?un={0}" Text="删除<br />组织" />
                    <asp:BoundField DataField="organizationid" HeaderText="组织ID" ReadOnly="True" 
                        SortExpression="organizationid" />
                    <asp:BoundField DataField="organizationname" HeaderText="组织名称" 
                        SortExpression="organizationname" />
                    <asp:BoundField DataField="realname" HeaderText="创建者" 
                        SortExpression="realname" />
                    <asp:CommandField ShowSelectButton="True" />
                </Columns>
                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                <SelectedRowStyle BackColor="White" Font-Bold="True" ForeColor="#003399" 
                    Font-Size="12px" />
                <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
        </div>
        <div id="right">
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" 
                CellPadding="3" DataKeyNames="organizationid" DataSourceID="SqlDataSource2" 
                GridLines="Horizontal">
                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                <Fields>
                    <asp:BoundField DataField="organizationid" HeaderText="组织ID" ReadOnly="True" 
                        SortExpression="organizationid" />
                    <asp:BoundField DataField="organizationname" HeaderText="组织名称" 
                        SortExpression="organizationname" />
                    <asp:BoundField DataField="address" HeaderText="组织地址" 
                        SortExpression="address" />
                    <asp:BoundField DataField="postcode" HeaderText="邮编" 
                        SortExpression="postcode" />
                    <asp:BoundField DataField="phone" HeaderText="单位电话" SortExpression="phone" />
                    <asp:BoundField DataField="creator" HeaderText="创建者" SortExpression="creator" />
                    <asp:BoundField DataField="createdtime" HeaderText="创建时间" 
                        SortExpression="createdtime" />
                    <asp:BoundField DataField="contactperson" HeaderText="联系人" 
                        SortExpression="contactperson" />
                    <asp:BoundField DataField="contactemail" HeaderText="联系人Email" 
                        SortExpression="contactemail" />
                    <asp:BoundField DataField="description" HeaderText="组织描述" 
                        SortExpression="description" />
                </Fields>
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                <AlternatingRowStyle BackColor="#F7F7F7" />
            </asp:DetailsView>
        </div>
        <div id="next">
            
        </div>
    </div>
    </div>
    </form>
</body>
</html>
